// 统一封装接口方法
// 每个方法负责请求一个url地址
// 导入接口方法即可发送请求
// url路径可在此统一管理
import axios from '@/utils/request.js'


// 获取歌曲详情:封面、歌手、歌名
export const getSongDetailAPI = (ids) => axios({
    url: '/song/detail',
    params: {
        ids
    }
})
// 获取歌词
export const getLyricAPI = (id) => axios({
    url: '/lyric',
    params: {
        id
    }
})
// 获取歌曲url
export const getSongUrlAPI = (id) => axios({
    url: '/song/url',
    params: {
        id
    }
})
// 轮播图
export const getBannerAPI = () => axios({
    url: '/banner',
})
//推荐歌单
export const getPersonalizedAPI = (limit) => axios({
    url: '/personalized',
    params: {
        limit
    }
})
// 最新音乐
export const getNewSongAPI = (limit) => axios({
    url: '/personalized/newsong',
    params: {
        limit
    }
})
// 推荐MV
export const getMvApi = () => axios({
    url: '/personalized/mv',
})
// 获取精品歌单
export const getHighqualityAPI = ({ limit, cat }) => axios({
    url: '/top/playlist/highquality',
    params: {
        limit,
        cat,
    }
})
// 精选歌单集
export const getTopPlaylistAPI = ({ limit, offset, cat }) => axios({
    url: '/top/playlist',
    params: {
        limit,
        offset,
        cat
    }
})
// 获取最新音乐
export const getTopSongAPI = ({ type }) => axios({
    url: '/top/song',
    params: {
        type
    }
})
// 获取最新MV
export const getMvAllAPI = ({ limit, order, area, type, offset }) => axios({
    url: '/mv/all',
    params: {
        limit,
        order,
        area,
        type,
        offset,
    }
})
// 搜索接口
export const searchAPI = ({ keywords, type, limit, offset }) => axios({
    url: '/search',
    params: {
        keywords,
        type,
        limit,
        offset,
    }
})
// 获取评论
export const getCommentAPI = ({ id, offset }) => axios({
    url: '/comment/playlist',
    params: {
        id,
        offset
    }
})
// 获取MV url
export const getMvUrlAPI = (id) => axios({
    url: '/mv/url',
    params: {
        id
    }
})
// 推荐相似MV
export const simiMvAPI = (mvid) => axios({
    url: '/simi/mv',
    params: {
        mvid
    }
})
// 获取MV信息
export const mvInfoAPI = (mvid) => axios({
    url: '/mv/detail',
    params: {
        mvid
    }
})
// 获取歌手封面
export const artistsAPI = (id) => axios({
    url: '/artists',
    params: {
        id
    }
})
// 获取热门MV
export const commentMvAPI = ({ id, offset }) => axios({
    url: '/comment/mv',
    params: {
        id,
        offset
    }
})
//获取详细歌单
export const playlistDetailAPI = (id) => axios({
    url: '/playlist/detail',
    params: {
        id
    }
})

